Merged
Conversation
Contributor
Author
|
Turns out my comment is incorrect -- it just never worked at all, rather than breaking in vs2026. I'll force push the comment away in a bit |
Daaaav
suggested changes
Nov 17, 2025
Contributor
Daaaav
left a comment
There was a problem hiding this comment.
Couple minor things:
- Maybe the
shortfor the version parts should beunsigned shortinstead - just because signed integer overflow is technically UB and unsigned integer overflow isn't (and so people in the year 70374794 will have a little more breathing room :P) - The name
is_validis a little confusing, I'd probably name it something likeis_ge,is_enough,version_is_met... I'd also place the declaration lower, closer to where it's used.
Other than that (and the VS2026 comment) lgtm!
This command adds `ifversion`, as both a simplified and internal command. The system works like so: - `ifversion(2.6,script2)` -> If you're on 2.6.0 or greater - `ifversion(2.6.0,script2)` -> Same as above - `ifversion(2.6.3,script2)` -> You're using 2.6.3 or greater - `ifversion(2.5,script2)` -> You're using 2.5 or greater - `ifversion(2,script2)` -> You're using 2.0.0 or greater (yep...) `ReleaseVersion.h` has a few new defines to make this possible, being `MAJOR_VERSION`, `MINOR_VERSION` and `PATCH_VERSION`. With the help of a few macros, `RELEASE_VERSION` is now constructed using those.
Contributor
Author
|
Fixed and force pushed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes:
This command adds
ifversion, as both a simplified and internal command.The system works like so:
ifversion(2.6,script2)-> If you're on 2.6.0 or greaterifversion(2.6.0,script2)-> Same as aboveifversion(2.6.3,script2)-> You're using 2.6.3 or greaterifversion(2.5,script2)-> You're using 2.5 or greaterifversion(2,script2)-> You're using 2.0.0 or greater (yep...)ReleaseVersion.hhas a few new defines to make this possible, beingMAJOR_VERSION,MINOR_VERSIONandPATCH_VERSION. With the help of a few macros,RELEASE_VERSIONis now constructed using those.There's been a long-running problem where people play levels which use new features, with older versions of the game. While this doesn't solve the problem for people playing in 2.2, or something, we can at least make a system now to lessen the issue for future versions. Ideally this'll be merged in for 2.5.
This PR was supposed to be paired with some XML tags, but my burnout hit hard and my free time is limited due to college. It'd require translation strings, rendering code, another complex level tag, etc. So, it's being left out for now; as I think
ifversionis better than nothing.Legal Stuff:
By submitting this pull request, I confirm that...
CONTRIBUTORSfile and the "GitHub Friends"section of the credits for all of said releases, but will NOT be compensated
for these changes unless there is a prior written agreement